﻿using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using Nest;

namespace Journeo_backend.Models.Domain
{
    // Attraction.cs
    [Table("attractions")]
    public class Attraction
    {
        [Key]
        [PropertyName("attractionId")]
        public long AttractionId { get; set; }

        [Required]
        [PropertyName("regionId")]
        public long RegionId { get; set; }

        [Required]
        [MaxLength(200)]
        [PropertyName("name")]
        public string Name { get; set; }

        [PropertyName("description")]
        public string? Description { get; set; }

        [PropertyName("address")]
        public string? Address { get; set; }

        [MaxLength(255)]
        [PropertyName("image")]
        public string? Image { get; set; }

        [PropertyName("latitude")]
        public decimal? Latitude { get; set; }

        [PropertyName("longitude")]
        public decimal? Longitude { get; set; }

        public decimal? AmapLatitude { get; set; }
        public decimal? AmapLongitude { get; set; }


        [PropertyName("priceRange")]
        public string? PriceRange { get; set; }

        [PropertyName("openingHours")]
        public string? OpeningHours { get; set; }

        public long LikeCount { get; set; } = 0;
        public long CommentCount { get; set; } = 0;

        [Required]
        [Range(0, 5)]
        [PropertyName("attractionRating")]
        public decimal? AttractionRating { get; set; }

        [PropertyName("recommendedVisitTime")]
        public string? RecommendedVisitTime { get; set; }

        [PropertyName("recommendedVisitSeason")]
        public string? RecommendedVisitSeason { get; set; }

        public long SelectCount { get; set; } = 0;

        public DateTime CreatedAt { get; set; } = DateTime.Now;

        public DateTime UpdatedAt { get; set; } = DateTime.Now;

        [ForeignKey("RegionId")]
        [Ignore]
        public Region Region { get; set; }
    }
}
